Use CRPEJob::GetNSortFields to determine the number of sort fields in the report.
short GetNSortFields ();